import request from "@/utils/request";

// 查看购物车列表
export const getShoppingList = ()=>{
    return request({
      url: '/api/cart/index',
      // headers:{
      //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
      // }
    })
}

// 选中操作
export const getChecked = data => {
  return request({
    url: '/api/cart/checked',
    method: 'POST',
    // headers:{
    //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
    // },
    data
  })
}

// 修改数量
export const editNum = data => {
  return request({
    url: '/api/cart/update',
    method: 'POST',
    // headers:{
    //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
    // },
    data
  })
}

// 删除购物车
export const delNum = data => {
  return request({
    url: '/api/cart/delete',
    method: 'POST',
    // headers:{
    //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
    // },
    data
  })
}

// 确认订单
export const checkoutOrder = params => {
  return request({
    url: '/api/cart/checkout',
    // headers:{
    //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
    // },
    params
  })
}

// 提交订单
export const orderInfo = data => {
  return request({
    url: '/api/order/submit',
    method: 'POST', 
    // headers:{
    //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
    // },
    data
  })
}

// 订单详情
export const orderDetail = params => {
  return request({
    url: '/api/order/detail',
    // headers:{
    //   'X-Nideshop-Token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMTEsImlhdCI6MTY0NjYyMTYwNn0.23K3O8oXe9M8r45-YXD8ML4AgyHpMg9nLbakFdEfyns'
    // },
    params
  })
}